import { lazy } from "react";
import {
  DesktopOutlined,
  FileOutlined,
  PieChartOutlined,
  TeamOutlined,
  UserOutlined,
} from '@ant-design/icons';
import { createBrowserRouter, Navigate } from "react-router-dom";
let Home = lazy(() => import("../page/home/Index"));
let Login = lazy(() => import("../page/login/Index"));
let My = lazy(() => import("../page/my/Index"));
let Order = lazy(() => import("../page/order/Index"));
let Qita = lazy(() => import("../page/qita/Index"));
let Xiangq = lazy(() => import("../page/xiangq/Index"));

export const Homerouter = [
  {
    path: "/home/order",
    element: <Order></Order>,
    label:'List',
    // label:'列表',
    icon:<DesktopOutlined></DesktopOutlined>
  },
  {
    path: "/home/qita",
    element: <Qita></Qita>,
    label:'Other',
    // label:'其他',
    icon:<FileOutlined></FileOutlined>
  },
  {
    path: "/home/my",
    element: <My></My>,
    label:'My',
    // label:'我的',
    icon:<PieChartOutlined></PieChartOutlined>
  },
];

const routers = createBrowserRouter([
  {
    path: "/",
    element: <Navigate to={"/home"}></Navigate>,
  },
  {
    path: "/home",
    element: <Home></Home>,
    children:Homerouter
  },
  {
    path: "/login",
    element: <Login></Login>,
  },
  {
    path: "/Xiangq/:id",
    element: <Xiangq></Xiangq>,
  },
]);

export default routers;
